<?php

class AjaxCheckPlugin extends Zend_Controller_Plugin_Abstract
{
	public function preDispatch(Zend_Controller_Request_Abstract $request)
	{
		//If the request is not an XHR, do nothing.
		if(!$request->isXmlHttpRequest()) return;

		// Disable layout
		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		
		// TODO: this doesnt really seem to work
		Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer')->setNoRender();
	}
}

